package com.aaa.bbb.mymaintain.api;
import com.aaa.bbb.common.http.ResponseResult;
import com.aaa.bbb.mymaintain.entity.Authority;
import com.aaa.bbb.mymaintain.service.AuthoritySer;
import com.aaa.bbb.common.sercurity.anno.AuthIgrone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author max
 * @since 2023-11-03
 */
@CrossOrigin
@RestController
@RequestMapping("/api/authority")
public class AuthorityCtl {
    @Autowired
    private AuthoritySer ser;

    @AuthIgrone
    @PostMapping("/getpost")
    public ResponseResult<List<Authority>> getPost() {
        return ResponseResult.getSuccessResult(ser.list());
    }

}

